home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 July / APC47-2.ISO / mac / macsbug / macsbug.hqx / MacsBug 6.5.4a6 / Building dcmds / C Samples / Metrowerks / MWDcmdShell.c < prev   
Encoding:
C/C++ Source or Header  |  1998-09-22  |  1.6 KB  |  73 lines

  1. /*
  2.     File:        MWDcmdShell.c
  3.  
  4.     Contains:    Dispatch code of a Metrowerks CodeWarrior-built dcmd. Developed with CW Pro 3.
  5.  
  6.     Version:    1.1
  7.  
  8.     Written by:    Greg Robbins and Jim Murphy
  9.  
  10.     Copyright:    ⌐ 1995, 1998 by Apple Computer, Inc., All Rights Reserved.
  11.  
  12.     File Ownership:
  13.  
  14.         DRI:                Jim Murphy
  15.  
  16.         Other Contact:        Dave Lyons
  17.  
  18.         Technology:            MacsBug
  19.  
  20.     Writers:
  21.  
  22.         (JM3)    Jim Murphy
  23.  
  24.     Change History (most recent first):
  25.  
  26.          <2>     7/13/98    JM3        No need to call Enter/ExitCodeResource, the glue now handles A4
  27.                                     transparently. Spell CodeWarrior correctly, duh. Version 1.1.
  28.          <1>     6/29/98    JM3        first checked in
  29.  
  30.     
  31.     
  32.  */
  33.  
  34.  
  35. #include <MacMemory.h>
  36. #include <MacTypes.h>
  37.  
  38. #include "dcmd.h"
  39.  
  40. pascal void CommandEntry (dcmdBlock* paramPtr);
  41.  
  42. //**********************************************************************************************************************
  43. //
  44. // CommandEntry - 
  45. //
  46.  
  47. pascal void CommandEntry (dcmdBlock* paramPtr)
  48. {
  49.  
  50.     static const char usageStr[] = "\p[usage options here] (Metrowerks CodeWarrior sample dcmd)";
  51.     
  52.     switch (paramPtr->request)
  53.     {
  54.         case dcmdInit:
  55.             break;
  56.  
  57.         case dcmdHelp:
  58.             dcmdDrawLine("\pThis is a sample dcmd written with Metrowerks CodeWarrior Pro 3");
  59.             dcmdDrawLine("\pby Jim Murphy and Greg Robbins");
  60.             break;
  61.  
  62.         case dcmdGetInfo:
  63.             * (long *) &((GetInfoRequestBlockPtr) paramPtr->requestIOBlock)->dcmdVersion = 0x01108000; // version 1.1 final
  64.             BlockMoveData(&usageStr, &((GetInfoRequestBlockPtr) paramPtr->requestIOBlock)->usageStr, usageStr[0]+1);
  65.             break;
  66.  
  67.         case dcmdDoIt:
  68.             dcmdDrawLine("\pMWDcmd says hello.");
  69.             break;
  70.     }
  71.  
  72. } // CommandEntry
  73.